<script src="__PUBLIC_JS__/layui/layui.js?v={:config('hisiphp.version')}"></script>
<script src="__PUBLIC_JS__/layui/formSelects-v4.js" type="text/javascript" charset="utf-8"></script>
<script>
    
    var ADMIN_PATH = "{$_SERVER['SCRIPT_NAME']}", LAYUI_OFFSET = 60;
    var ADMIN_ID = "{:isset($login)?arrayGet($login, 'uid', 0):0}";
    layui.config({
    	base: '__ADMIN_JS__/',
        version: '{:config("hisiphp.version")}'
    }).extend({
        opTable:'opTable/opTable',
    }).use('global');
    
    layui.use(['jquery', 'element', 'layer','cookie'], function() {
        var $ = layui.jquery, element = layui.element, layer = layui.layer,cookie=layui.cookie;
        var href=window.location.href;
        var tips="{:session('tips')}";
        
        // 通知弹窗
        var index = parent.layer.getFrameIndex(window.name); 
        if (typeof(index) == "undefined") {
       		$.ajax({
    	           type: "POST",
    	           url: "{:url('system/index/noticeShow')}",
    	           data: "",
    	           dataType:"json",
    	           success: function(res){
    	               if(res.code == 1 && tips != res.data.id && href.indexOf("noticeShow")==-1 && href.indexOf("welcome")==-1 && href.indexOf("system/publics/index")==-1){
    	            	    layer.open({
								type: 1,    	            	    	
    		                    title: res.data.title + ' - 公告详情',
    		                    btn: [ '知道了'],
    		                    shadeClose: true,
    		                    shade: 0.8,
    		                    area: ['95%', '95%'],
    		                    content: res.data.content,
    		                    maxmin: true,
    		                    btn1:function(){
    		                        $.ajax({
    		                            type: "POST",
    		                            url: "{:url('system/index/setTips')}?id="+ res.data.id,
    		                            dataType:"json",
    		                            success: function(res){
    		                            	if (res.code == 0) layer.msg(res.msg, {icon: 2,anim: 6});
    		                            }
    		                        });
    		                        layer.closeAll();  
    		                    },
    	                  });
    	               }
    	               element.init();
    	           }
    	        });
       	}
        //记录 pv uv ip信息
        layui.jquery.ajax({
            type: "POST",
            url: "{:url('mp/Pvuvip/index')}",
            data: {url_str:window.location.href},
            dataType: "json",
            success: function (res) {
            }
        });
    });

</script>